home *** CD-ROM | disk | FTP | other *** search
- global gVariable, gCast, gSize, gFirstColor, gAirbrushSize, gAirbrushShape, gAirbrushMask, myCurrentImage, myCurrentPreview
-
- on toolAirbrush
- member("state1 - " & gSize, gCast).image = member(gSize & "x" & gSize, gCast).image
- myCurrentImage = duplicate(member(gSize & "x" & gSize, gCast).image)
- myCurrentPreview = duplicate(member("preview", gCast).image)
- repeat while the mouseDown
- if gAirbrushShape = #rect then
- if gAirbrushSize = 7 then
- randomX = random(((the mouseH - sprite(1).left) * 2 / gVariable / 2) - (gAirbrushSize / 2), ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + (gAirbrushSize / 2))
- randomY = random(((the mouseV - sprite(1).top) * 2 / gVariable / 2) - (gAirbrushSize / 2), ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + (gAirbrushSize / 2))
- myCurrentImage.setPixel(randomX, randomY, gFirstColor)
- randomX = random(((the mouseH - sprite(1).left) * 2 / gVariable / 2) - (gAirbrushSize / 2), ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + (gAirbrushSize / 2))
- randomY = random(((the mouseV - sprite(1).top) * 2 / gVariable / 2) - (gAirbrushSize / 2), ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + (gAirbrushSize / 2))
- myCurrentImage.setPixel(randomX, randomY, gFirstColor)
- randomX = random(((the mouseH - sprite(1).left) * 2 / gVariable / 2) - (gAirbrushSize / 2), ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + (gAirbrushSize / 2))
- randomY = random(((the mouseV - sprite(1).top) * 2 / gVariable / 2) - (gAirbrushSize / 2), ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + (gAirbrushSize / 2))
- myCurrentImage.setPixel(randomX, randomY, gFirstColor)
- else
- if gAirbrushSize = 5 then
- randomX = random(((the mouseH - sprite(1).left) * 2 / gVariable / 2) - (gAirbrushSize / 2), ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + (gAirbrushSize / 2))
- randomY = random(((the mouseV - sprite(1).top) * 2 / gVariable / 2) - (gAirbrushSize / 2), ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + (gAirbrushSize / 2))
- myCurrentImage.setPixel(randomX, randomY, gFirstColor)
- randomX = random(((the mouseH - sprite(1).left) * 2 / gVariable / 2) - (gAirbrushSize / 2), ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + (gAirbrushSize / 2))
- randomY = random(((the mouseV - sprite(1).top) * 2 / gVariable / 2) - (gAirbrushSize / 2), ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + (gAirbrushSize / 2))
- myCurrentImage.setPixel(randomX, randomY, gFirstColor)
- else
- if gAirbrushSize = 3 then
- randomX = random(((the mouseH - sprite(1).left) * 2 / gVariable / 2) - (gAirbrushSize / 2), ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + (gAirbrushSize / 2))
- randomY = random(((the mouseV - sprite(1).top) * 2 / gVariable / 2) - (gAirbrushSize / 2), ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + (gAirbrushSize / 2))
- myCurrentImage.setPixel(randomX, randomY, gFirstColor)
- end if
- end if
- end if
- else
- if gAirbrushSize = 7 then
- randomX = random(((the mouseH - sprite(1).left) * 2 / gVariable / 2) - 1, ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + 1)
- randomY = random(((the mouseV - sprite(1).top) * 2 / gVariable / 2) - 3, ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + 3)
- myCurrentImage.setPixel(randomX, randomY, gFirstColor)
- randomX = random(((the mouseH - sprite(1).left) * 2 / gVariable / 2) - 3, ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + 3)
- randomY = random(((the mouseV - sprite(1).top) * 2 / gVariable / 2) - 1, ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + 1)
- myCurrentImage.setPixel(randomX, randomY, gFirstColor)
- randomX = random(((the mouseH - sprite(1).left) * 2 / gVariable / 2) - 2, ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + 2)
- randomY = random(((the mouseV - sprite(1).top) * 2 / gVariable / 2) - 2, (the mouseV - sprite(1).top) * 2 / gVariable / 2)
- myCurrentImage.setPixel(randomX, randomY, gFirstColor)
- randomX = random(((the mouseH - sprite(1).left) * 2 / gVariable / 2) - 2, ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + 2)
- randomY = random((the mouseV - sprite(1).top) * 2 / gVariable / 2, ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + 2)
- myCurrentImage.setPixel(randomX, randomY, gFirstColor)
- else
- if gAirbrushSize = 5 then
- randomX = random(((the mouseH - sprite(1).left) * 2 / gVariable / 2) - 1, ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + 1)
- randomY = random(((the mouseV - sprite(1).top) * 2 / gVariable / 2) - 2, ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + 2)
- myCurrentImage.setPixel(randomX, randomY, gFirstColor)
- randomX = random(((the mouseH - sprite(1).left) * 2 / gVariable / 2) - 2, ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + 2)
- randomY = random(((the mouseV - sprite(1).top) * 2 / gVariable / 2) - 1, ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + 1)
- myCurrentImage.setPixel(randomX, randomY, gFirstColor)
- else
- if gAirbrushSize = 3 then
- randomX = (the mouseH - sprite(1).left) * 2 / gVariable / 2
- randomY = random(((the mouseV - sprite(1).top) * 2 / gVariable / 2) - 1, ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + 1)
- myCurrentImage.setPixel(randomX, randomY, gFirstColor)
- randomX = random(((the mouseH - sprite(1).left) * 2 / gVariable / 2) - 1, ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + 1)
- randomY = (the mouseV - sprite(1).top) * 2 / gVariable / 2
- myCurrentImage.setPixel(randomX, randomY, gFirstColor)
- end if
- end if
- end if
- end if
- member(gSize & "x" & gSize, gCast).image.copyPixels(myCurrentImage, myCurrentImage.rect, myCurrentImage.rect)
- sprite(8).rect = rect(the mouseH - (gAirbrushSize * gVariable / 2), the mouseV - (gAirbrushSize * gVariable / 2), the mouseH + (gAirbrushSize * gVariable / 2), the mouseV + (gAirbrushSize * gVariable / 2))
- updateStage()
- put (the mouseH - sprite(1).left) * 2 / gVariable / 2 into field "location status X"
- put (the mouseV - sprite(1).top) * 2 / gVariable / 2 into field "location status Y"
- fnUpdatePreview()
- end repeat
- sprite(35).pState = 0
- sendSprite(35, #setMember)
- member("state2 - " & gSize, gCast).image = member(gSize & "x" & gSize, gCast).image
- myCurrentImage = VOID
- myCurrentPreview = VOID
- put EMPTY into field "location status X"
- put EMPTY into field "location status Y"
- end
-
- on toolRGBAirbrush
- member("state1 - " & gSize, gCast).image = member(gSize & "x" & gSize, gCast).image
- coordinateList = []
- coordinateList.add((the mouseH - sprite(1).left) * 2 / gVariable / 2)
- coordinateList.add((the mouseV - sprite(1).top) * 2 / gVariable / 2)
- member(gSize & "x" & gSize, gCast).image.copyPixels(member("1st Color", gCast).image, rect(((the mouseH - sprite(1).left) * 2 / gVariable / 2) - 4, ((the mouseV - sprite(1).top) * 2 / gVariable / 2) - 4, ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + 5, ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + 5), rect(0, 0, 9, 9), [#blendLevel: 5, #maskImage: member(gAirbrushMask).image.createMask()])
- sprite(8).rect = rect(the mouseH - (gAirbrushSize * gVariable / 2), the mouseV - (gAirbrushSize * gVariable / 2), the mouseH + (gAirbrushSize * gVariable / 2), the mouseV + (gAirbrushSize * gVariable / 2))
- updateStage()
- myCurrentImage = duplicate(member(gSize & "x" & gSize, gCast).image)
- myCurrentPreview = duplicate(member("preview", gCast).image)
- repeat while the mouseDown
- if (getAt(coordinateList, 1) = ((the mouseH - sprite(1).left) * 2 / gVariable / 2)) and (getAt(coordinateList, 2) = ((the mouseV - sprite(1).top) * 2 / gVariable / 2)) then
- nothing()
- else
- coordinateList.add((the mouseH - sprite(1).left) * 2 / gVariable / 2)
- coordinateList.add((the mouseV - sprite(1).top) * 2 / gVariable / 2)
- numSteps = float(sqrt(power(getAt(coordinateList, 1) - getAt(coordinateList, 3), 2) + power(getAt(coordinateList, 2) - getAt(coordinateList, 4), 2))) + 1
- repeat with i = 1 to numSteps
- l = (getAt(coordinateList, 1) * (numSteps - float(i)) / numSteps) + (getAt(coordinateList, 3) * (float(i) / numSteps))
- t = (getAt(coordinateList, 2) * (numSteps - float(i)) / numSteps) + (getAt(coordinateList, 4) * (float(i) / numSteps))
- myCurrentImage.copyPixels(member("1st Color", gCast).image, rect(l - 4, t - 4, l + 5, t + 5), rect(0, 0, 9, 9), [#blendLevel: 5, #maskImage: member(gAirbrushMask).image.createMask()])
- end repeat
- deleteAt(coordinateList, 1)
- deleteAt(coordinateList, 1)
- member(gSize & "x" & gSize, gCast).image.copyPixels(myCurrentImage, myCurrentImage.rect, myCurrentImage.rect)
- sprite(8).rect = rect(the mouseH - (gAirbrushSize * gVariable / 2), the mouseV - (gAirbrushSize * gVariable / 2), the mouseH + (gAirbrushSize * gVariable / 2), the mouseV + (gAirbrushSize * gVariable / 2))
- updateStage()
- end if
- put (the mouseH - sprite(1).left) * 2 / gVariable / 2 into field "location status X"
- put (the mouseV - sprite(1).top) * 2 / gVariable / 2 into field "location status Y"
- fnUpdatePreview()
- end repeat
- coordinateList = VOID
- sprite(35).pState = 0
- sendSprite(35, #setMember)
- member("state2 - " & gSize, gCast).image = member(gSize & "x" & gSize, gCast).image
- myCurrentImage = VOID
- myCurrentPreview = VOID
- put EMPTY into field "location status X"
- put EMPTY into field "location status Y"
- end
-